<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: Red-black tree manipulation module</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__gdsl__rbtree.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Red-black tree manipulation module</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct gdsl_rbtree *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7">gdsl_rbtree_alloc</a> (const char *NAME, <a class="el" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f">gdsl_alloc_func_t</a> ALLOC_F, <a class="el" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053">gdsl_free_func_t</a> FREE_F, <a class="el" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a> COMP_F)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new red-black tree.  <a href="#gaced9f13fd9bd4cd9d9c27aeadffa35e7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga3740ac9553a92092fca0d0d7803404b7">gdsl_rbtree_free</a> (<a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a red-black tree.  <a href="#ga3740ac9553a92092fca0d0d7803404b7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga66fdc368ed633539d71f2a485d7c6052">gdsl_rbtree_flush</a> (<a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Flush a red-black tree.  <a href="#ga66fdc368ed633539d71f2a485d7c6052"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga2e908aaf5ea816b4cf5acbcb5ba4011e">gdsl_rbtree_get_name</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the name of a red-black tree.  <a href="#ga2e908aaf5ea816b4cf5acbcb5ba4011e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#gaf6a258d8f3ee5206d682d799316314b1">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga2d21a1abf59af6b8db454ec4ddab4cb9">gdsl_rbtree_is_empty</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a red-black tree is empty.  <a href="#ga2d21a1abf59af6b8db454ec4ddab4cb9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga260cf7c8c18241ba83e115cbd2f34c32">gdsl_rbtree_get_root</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the root of a red-black tree.  <a href="#ga260cf7c8c18241ba83e115cbd2f34c32"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gaa444fc6695317a905c6c22715e163c2b">gdsl_rbtree_get_size</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the size of a red-black tree.  <a href="#gaa444fc6695317a905c6c22715e163c2b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga875c222e6575fd1ce17c58a30f5c693a">gdsl_rbtree_height</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the height of a red-black tree.  <a href="#ga875c222e6575fd1ce17c58a30f5c693a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga088daaa858f351d7d18d9501a12b30e3">gdsl_rbtree_set_name</a> (<a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, const char *NEW_NAME)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the name of a red-black tree.  <a href="#ga088daaa858f351d7d18d9501a12b30e3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga37088d5953e6800d9276a6286bf12521">gdsl_rbtree_insert</a> (<a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, void *VALUE, int *RESULT)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert an element into a red-black tree if it's not found or return it.  <a href="#ga37088d5953e6800d9276a6286bf12521"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gaa9d34dd8149e458dc0306cd6caabf516">gdsl_rbtree_remove</a> (<a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, void *VALUE)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an element from a red-black tree.  <a href="#gaa9d34dd8149e458dc0306cd6caabf516"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga1f9cfaf592b74449a103d550c0c05eb5">gdsl_rbtree_delete</a> (<a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, void *VALUE)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete an element from a red-black tree.  <a href="#ga1f9cfaf592b74449a103d550c0c05eb5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gacb481b6b1bbcfc424897d5e1056516b7">gdsl_rbtree_search</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a> COMP_F, void *VALUE)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Search for a particular element into a red-black tree.  <a href="#gacb481b6b1bbcfc424897d5e1056516b7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gae2908f10ff9e46db4693a051adcb5fa3">gdsl_rbtree_map_prefix</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a> MAP_F, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a red-black tree in prefixed order.  <a href="#gae2908f10ff9e46db4693a051adcb5fa3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga4a4cd2c7801ab55e6d0913bb94b44a3b">gdsl_rbtree_map_infix</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a> MAP_F, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a red-black tree in infixed order.  <a href="#ga4a4cd2c7801ab55e6d0913bb94b44a3b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gaf94da0ad1d02db0f9c10e9f5a95d28ae">gdsl_rbtree_map_postfix</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a> MAP_F, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a red-black tree in postfixed order.  <a href="#gaf94da0ad1d02db0f9c10e9f5a95d28ae"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9">gdsl_rbtree_write</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a> WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the element of each node of a red-black tree to a file.  <a href="#ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#gadf28f012b77d91409e2a4c0de0498bc7">gdsl_rbtree_write_xml</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a> WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the content of a red-black tree to a file into XML.  <a href="#gadf28f012b77d91409e2a4c0de0498bc7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gdsl__rbtree.html#ga410a6b15d94f9b5a6cf834716893e911">gdsl_rbtree_dump</a> (const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> T, <a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a> WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump the internal structure of a red-black tree to a file.  <a href="#ga410a6b15d94f9b5a6cf834716893e911"></a><br/></td></tr>
</table>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gab8c3c4319c7631622af23e39a7870c2b"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_t" ref="gab8c3c4319c7631622af23e39a7870c2b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct gdsl_rbtree* <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>GDSL red-black tree type.</p>
<p>This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module. </p>

<p>Definition at line <a class="el" href="gdsl__rbtree_8h_source.html#l00052">52</a> of file <a class="el" href="gdsl__rbtree_8h_source.html">gdsl_rbtree.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaced9f13fd9bd4cd9d9c27aeadffa35e7"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_alloc" ref="gaced9f13fd9bd4cd9d9c27aeadffa35e7" args="(const char *NAME, gdsl_alloc_func_t ALLOC_F, gdsl_free_func_t FREE_F, gdsl_compare_func_t COMP_F)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7">gdsl_rbtree_alloc</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>NAME</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f">gdsl_alloc_func_t</a>&#160;</td>
          <td class="paramname"><em>ALLOC_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053">gdsl_free_func_t</a>&#160;</td>
          <td class="paramname"><em>FREE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a>&#160;</td>
          <td class="paramname"><em>COMP_F</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a new red-black tree. </p>
<p>Allocate a new red-black tree data structure which name is set to a copy of NAME. The function pointers ALLOC_F, FREE_F and COMP_F could be used to respectively, alloc, free and compares elements in the tree. These pointers could be set to NULL to use the default ones:</p>
<ul>
<li>the default ALLOC_F simply returns its argument</li>
<li>the default FREE_F does nothing</li>
<li>the default COMP_F always returns 0</li>
</ul>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>nothing </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">NAME</td><td>The name of the new red-black tree to create </td></tr>
    <tr><td class="paramname">ALLOC_F</td><td>Function to alloc element when inserting it in a r-b tree </td></tr>
    <tr><td class="paramname">FREE_F</td><td>Function to free element when removing it from a r-b tree </td></tr>
    <tr><td class="paramname">COMP_F</td><td>Function to compare elements into the r-b tree </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the newly allocated red-black tree in case of success. </dd>
<dd>
NULL in case of failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga3740ac9553a92092fca0d0d7803404b7" title="Destroy a red-black tree.">gdsl_rbtree_free()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga66fdc368ed633539d71f2a485d7c6052" title="Flush a red-black tree.">gdsl_rbtree_flush()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga3740ac9553a92092fca0d0d7803404b7"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_free" ref="ga3740ac9553a92092fca0d0d7803404b7" args="(gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__rbtree.html#ga3740ac9553a92092fca0d0d7803404b7">gdsl_rbtree_free</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destroy a red-black tree. </p>
<p>Deallocate all the elements of the red-black tree T by calling T's FREE_F function passed to <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a>. The name of T is deallocated and T is deallocated itself too.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to deallocate </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga66fdc368ed633539d71f2a485d7c6052" title="Flush a red-black tree.">gdsl_rbtree_flush()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga66fdc368ed633539d71f2a485d7c6052"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_flush" ref="ga66fdc368ed633539d71f2a485d7c6052" args="(gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__rbtree.html#ga66fdc368ed633539d71f2a485d7c6052">gdsl_rbtree_flush</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Flush a red-black tree. </p>
<p>Deallocate all the elements of the red-black tree T by calling T's FREE_F function passed to <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a>. The red-black tree T is not deallocated itself and its name is not modified.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga3740ac9553a92092fca0d0d7803404b7" title="Destroy a red-black tree.">gdsl_rbtree_free()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga2e908aaf5ea816b4cf5acbcb5ba4011e"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_get_name" ref="ga2e908aaf5ea816b4cf5acbcb5ba4011e" args="(const gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* <a class="el" href="group__gdsl__rbtree.html#ga2e908aaf5ea816b4cf5acbcb5ba4011e">gdsl_rbtree_get_name</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the name of a red-black tree. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd>The returned string MUST NOT be freed. </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to get the name from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the name of the red-black tree T. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga088daaa858f351d7d18d9501a12b30e3" title="Set the name of a red-black tree.">gdsl_rbtree_set_name()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga2d21a1abf59af6b8db454ec4ddab4cb9"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_is_empty" ref="ga2d21a1abf59af6b8db454ec4ddab4cb9" args="(const gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#gaf6a258d8f3ee5206d682d799316314b1">bool</a> <a class="el" href="group__gdsl__rbtree.html#ga2d21a1abf59af6b8db454ec4ddab4cb9">gdsl_rbtree_is_empty</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if a red-black tree is empty. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if the red-black tree T is empty. </dd>
<dd>
FALSE if the red-black tree T is not empty. </dd></dl>

</div>
</div>
<a class="anchor" id="ga260cf7c8c18241ba83e115cbd2f34c32"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_get_root" ref="ga260cf7c8c18241ba83e115cbd2f34c32" args="(const gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#ga260cf7c8c18241ba83e115cbd2f34c32">gdsl_rbtree_get_root</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the root of a red-black tree. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to get the root element from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the element at the root of the red-black tree T. </dd></dl>

</div>
</div>
<a class="anchor" id="gaa444fc6695317a905c6c22715e163c2b"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_get_size" ref="gaa444fc6695317a905c6c22715e163c2b" args="(const gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> <a class="el" href="group__gdsl__rbtree.html#gaa444fc6695317a905c6c22715e163c2b">gdsl_rbtree_get_size</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the size of a red-black tree. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to get the size from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the size of the red-black tree T (noted |T|). </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>gdsl_rbtree_get_height() </dd></dl>

</div>
</div>
<a class="anchor" id="ga875c222e6575fd1ce17c58a30f5c693a"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_height" ref="ga875c222e6575fd1ce17c58a30f5c693a" args="(const gdsl_rbtree_t T)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> <a class="el" href="group__gdsl__rbtree.html#ga875c222e6575fd1ce17c58a30f5c693a">gdsl_rbtree_height</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the height of a red-black tree. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to compute the height from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the height of the red-black tree T (noted h(T)). </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gaa444fc6695317a905c6c22715e163c2b" title="Get the size of a red-black tree.">gdsl_rbtree_get_size()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga088daaa858f351d7d18d9501a12b30e3"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_set_name" ref="ga088daaa858f351d7d18d9501a12b30e3" args="(gdsl_rbtree_t T, const char *NEW_NAME)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> <a class="el" href="group__gdsl__rbtree.html#ga088daaa858f351d7d18d9501a12b30e3">gdsl_rbtree_set_name</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>NEW_NAME</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the name of a red-black tree. </p>
<p>Change the previous name of the red-black tree T to a copy of NEW_NAME.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to change the name </td></tr>
    <tr><td class="paramname">NEW_NAME</td><td>The new name of T </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the modified red-black tree in case of success. </dd>
<dd>
NULL in case of insufficient memory. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga2e908aaf5ea816b4cf5acbcb5ba4011e" title="Get the name of a red-black tree.">gdsl_rbtree_get_name()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga37088d5953e6800d9276a6286bf12521"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_insert" ref="ga37088d5953e6800d9276a6286bf12521" args="(gdsl_rbtree_t T, void *VALUE, int *RESULT)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#ga37088d5953e6800d9276a6286bf12521">gdsl_rbtree_insert</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>VALUE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>RESULT</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Insert an element into a red-black tree if it's not found or return it. </p>
<p>Search for the first element E equal to VALUE into the red-black tree T, by using T's COMP_F function passed to gdsl_rbtree_alloc to find it. If E is found, then it's returned. If E isn't found, then a new element E is allocated using T's ALLOC_F function passed to gdsl_rbtree_alloc and is inserted and then returned.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( log( |T| ) ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; RESULT != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to modify </td></tr>
    <tr><td class="paramname">VALUE</td><td>The value used to make the new element to insert into T </td></tr>
    <tr><td class="paramname">RESULT</td><td>The address where the result code will be stored. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the element E and RESULT = GDSL_OK if E is inserted into T. </dd>
<dd>
the element E and RESULT = GDSL_ERR_DUPLICATE_ENTRY if E is already present in T. </dd>
<dd>
NULL and RESULT = GDSL_ERR_MEM_ALLOC in case of insufficient memory. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gaa9d34dd8149e458dc0306cd6caabf516" title="Remove an element from a red-black tree.">gdsl_rbtree_remove()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga1f9cfaf592b74449a103d550c0c05eb5" title="Delete an element from a red-black tree.">gdsl_rbtree_delete()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gaa9d34dd8149e458dc0306cd6caabf516"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_remove" ref="gaa9d34dd8149e458dc0306cd6caabf516" args="(gdsl_rbtree_t T, void *VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#gaa9d34dd8149e458dc0306cd6caabf516">gdsl_rbtree_remove</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>VALUE</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove an element from a red-black tree. </p>
<p>Remove from the red-black tree T the first founded element E equal to VALUE, by using T's COMP_F function passed to <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a>. If E is found, it is removed from T and then returned.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( log ( |T| ) ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to modify </td></tr>
    <tr><td class="paramname">VALUE</td><td>The value used to find the element to remove </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first founded element equal to VALUE in T in case is found. </dd>
<dd>
NULL in case no element equal to VALUE is found in T. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga37088d5953e6800d9276a6286bf12521" title="Insert an element into a red-black tree if it&#39;s not found or return it.">gdsl_rbtree_insert()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga1f9cfaf592b74449a103d550c0c05eb5" title="Delete an element from a red-black tree.">gdsl_rbtree_delete()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga1f9cfaf592b74449a103d550c0c05eb5"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_delete" ref="ga1f9cfaf592b74449a103d550c0c05eb5" args="(gdsl_rbtree_t T, void *VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a> <a class="el" href="group__gdsl__rbtree.html#ga1f9cfaf592b74449a103d550c0c05eb5">gdsl_rbtree_delete</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>VALUE</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Delete an element from a red-black tree. </p>
<p>Remove from the red-black tree the first founded element E equal to VALUE, by using T's COMP_F function passed to <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a>. If E is found, it is removed from T and E is deallocated using T's FREE_F function passed to <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a>, then T is returned.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( log( |T| ) ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to remove an element from </td></tr>
    <tr><td class="paramname">VALUE</td><td>The value used to find the element to remove </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the modified red-black tree after removal of E if E was found. </dd>
<dd>
NULL if no element equal to VALUE was found. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga37088d5953e6800d9276a6286bf12521" title="Insert an element into a red-black tree if it&#39;s not found or return it.">gdsl_rbtree_insert()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#gaa9d34dd8149e458dc0306cd6caabf516" title="Remove an element from a red-black tree.">gdsl_rbtree_remove()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gacb481b6b1bbcfc424897d5e1056516b7"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_search" ref="gacb481b6b1bbcfc424897d5e1056516b7" args="(const gdsl_rbtree_t T, gdsl_compare_func_t COMP_F, void *VALUE)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#gacb481b6b1bbcfc424897d5e1056516b7">gdsl_rbtree_search</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a>&#160;</td>
          <td class="paramname"><em>COMP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>VALUE</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Search for a particular element into a red-black tree. </p>
<p>Search the first element E equal to VALUE in the red-black tree T, by using COMP_F function to find it. If COMP_F == NULL, then the COMP_F function passed to <a class="el" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc()</a> is used.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( log( |T| ) ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to use. </td></tr>
    <tr><td class="paramname">COMP_F</td><td>The comparison function to use to compare T's element with VALUE to find the element E (or NULL to use the default T's COMP_F) </td></tr>
    <tr><td class="paramname">VALUE</td><td>The value that must be used by COMP_F to find the element E </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first founded element E equal to VALUE. </dd>
<dd>
NULL if VALUE is not found in T. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga37088d5953e6800d9276a6286bf12521" title="Insert an element into a red-black tree if it&#39;s not found or return it.">gdsl_rbtree_insert()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#gaa9d34dd8149e458dc0306cd6caabf516" title="Remove an element from a red-black tree.">gdsl_rbtree_remove()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga1f9cfaf592b74449a103d550c0c05eb5" title="Delete an element from a red-black tree.">gdsl_rbtree_delete()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gae2908f10ff9e46db4693a051adcb5fa3"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_map_prefix" ref="gae2908f10ff9e46db4693a051adcb5fa3" args="(const gdsl_rbtree_t T, gdsl_map_func_t MAP_F, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#gae2908f10ff9e46db4693a051adcb5fa3">gdsl_rbtree_map_prefix</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a>&#160;</td>
          <td class="paramname"><em>MAP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Parse a red-black tree in prefixed order. </p>
<p>Parse all nodes of the red-black tree T in prefixed order. The MAP_F function is called on the element contained in each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then <a class="el" href="group__gdsl__rbtree.html#gae2908f10ff9e46db4693a051adcb5fa3" title="Parse a red-black tree in prefixed order.">gdsl_rbtree_map_prefix()</a> stops and returns its last examinated element.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; MAP_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to map. </td></tr>
    <tr><td class="paramname">MAP_F</td><td>The map function. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to MAP_F </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first element for which MAP_F returns GDSL_MAP_STOP. </dd>
<dd>
NULL when the parsing is done. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga4a4cd2c7801ab55e6d0913bb94b44a3b" title="Parse a red-black tree in infixed order.">gdsl_rbtree_map_infix()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#gaf94da0ad1d02db0f9c10e9f5a95d28ae" title="Parse a red-black tree in postfixed order.">gdsl_rbtree_map_postfix()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga4a4cd2c7801ab55e6d0913bb94b44a3b"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_map_infix" ref="ga4a4cd2c7801ab55e6d0913bb94b44a3b" args="(const gdsl_rbtree_t T, gdsl_map_func_t MAP_F, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#ga4a4cd2c7801ab55e6d0913bb94b44a3b">gdsl_rbtree_map_infix</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a>&#160;</td>
          <td class="paramname"><em>MAP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Parse a red-black tree in infixed order. </p>
<p>Parse all nodes of the red-black tree T in infixed order. The MAP_F function is called on the element contained in each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then <a class="el" href="group__gdsl__rbtree.html#ga4a4cd2c7801ab55e6d0913bb94b44a3b" title="Parse a red-black tree in infixed order.">gdsl_rbtree_map_infix()</a> stops and returns its last examinated element.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; MAP_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to map. </td></tr>
    <tr><td class="paramname">MAP_F</td><td>The map function. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to MAP_F </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first element for which MAP_F returns GDSL_MAP_STOP. </dd>
<dd>
NULL when the parsing is done. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gae2908f10ff9e46db4693a051adcb5fa3" title="Parse a red-black tree in prefixed order.">gdsl_rbtree_map_prefix()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#gaf94da0ad1d02db0f9c10e9f5a95d28ae" title="Parse a red-black tree in postfixed order.">gdsl_rbtree_map_postfix()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gaf94da0ad1d02db0f9c10e9f5a95d28ae"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_map_postfix" ref="gaf94da0ad1d02db0f9c10e9f5a95d28ae" args="(const gdsl_rbtree_t T, gdsl_map_func_t MAP_F, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> <a class="el" href="group__gdsl__rbtree.html#gaf94da0ad1d02db0f9c10e9f5a95d28ae">gdsl_rbtree_map_postfix</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8">gdsl_map_func_t</a>&#160;</td>
          <td class="paramname"><em>MAP_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Parse a red-black tree in postfixed order. </p>
<p>Parse all nodes of the red-black tree T in postfixed order. The MAP_F function is called on the element contained in each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then <a class="el" href="group__gdsl__rbtree.html#gaf94da0ad1d02db0f9c10e9f5a95d28ae" title="Parse a red-black tree in postfixed order.">gdsl_rbtree_map_postfix()</a> stops and returns its last examinated element.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; MAP_F != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to map. </td></tr>
    <tr><td class="paramname">MAP_F</td><td>The map function. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to MAP_F </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the first element for which MAP_F returns GDSL_MAP_STOP. </dd>
<dd>
NULL when the parsing is done. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gae2908f10ff9e46db4693a051adcb5fa3" title="Parse a red-black tree in prefixed order.">gdsl_rbtree_map_prefix()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga4a4cd2c7801ab55e6d0913bb94b44a3b" title="Parse a red-black tree in infixed order.">gdsl_rbtree_map_infix()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_write" ref="ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9" args="(const gdsl_rbtree_t T, gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__rbtree.html#ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9">gdsl_rbtree_write</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a>&#160;</td>
          <td class="paramname"><em>WRITE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>OUTPUT_FILE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write the element of each node of a red-black tree to a file. </p>
<p>Write the nodes elements of the red-black tree T to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; WRITE_F != NULL &amp; OUTPUT_FILE != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to write. </td></tr>
    <tr><td class="paramname">WRITE_F</td><td>The write function. </td></tr>
    <tr><td class="paramname">OUTPUT_FILE</td><td>The file where to write T's elements. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to WRITE_F. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#gadf28f012b77d91409e2a4c0de0498bc7" title="Write the content of a red-black tree to a file into XML.">gdsl_rbtree_write_xml()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga410a6b15d94f9b5a6cf834716893e911" title="Dump the internal structure of a red-black tree to a file.">gdsl_rbtree_dump()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gadf28f012b77d91409e2a4c0de0498bc7"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_write_xml" ref="gadf28f012b77d91409e2a4c0de0498bc7" args="(const gdsl_rbtree_t T, gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__rbtree.html#gadf28f012b77d91409e2a4c0de0498bc7">gdsl_rbtree_write_xml</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a>&#160;</td>
          <td class="paramname"><em>WRITE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>OUTPUT_FILE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write the content of a red-black tree to a file into XML. </p>
<p>Write the nodes elements of the red-black tree T to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then use WRITE_F to write T's nodes elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; OUTPUT_FILE != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to write. </td></tr>
    <tr><td class="paramname">WRITE_F</td><td>The write function. </td></tr>
    <tr><td class="paramname">OUTPUT_FILE</td><td>The file where to write T's elements. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to WRITE_F. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9" title="Write the element of each node of a red-black tree to a file.">gdsl_rbtree_write()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#ga410a6b15d94f9b5a6cf834716893e911" title="Dump the internal structure of a red-black tree to a file.">gdsl_rbtree_dump()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga410a6b15d94f9b5a6cf834716893e911"></a><!-- doxytag: member="gdsl_rbtree.h::gdsl_rbtree_dump" ref="ga410a6b15d94f9b5a6cf834716893e911" args="(const gdsl_rbtree_t T, gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__gdsl__rbtree.html#ga410a6b15d94f9b5a6cf834716893e911">gdsl_rbtree_dump</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6">gdsl_write_func_t</a>&#160;</td>
          <td class="paramname"><em>WRITE_F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>OUTPUT_FILE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>USER_DATA</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dump the internal structure of a red-black tree to a file. </p>
<p>Dump the structure of the red-black tree T to OUTPUT_FILE. If WRITE_F != NULL, then use WRITE_F to write T's nodes elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>T must be a valid gdsl_rbtree_t &amp; OUTPUT_FILE != NULL </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">T</td><td>The red-black tree to write. </td></tr>
    <tr><td class="paramname">WRITE_F</td><td>The write function. </td></tr>
    <tr><td class="paramname">OUTPUT_FILE</td><td>The file where to write T's elements. </td></tr>
    <tr><td class="paramname">USER_DATA</td><td>User's datas passed to WRITE_F. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__rbtree.html#ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9" title="Write the element of each node of a red-black tree to a file.">gdsl_rbtree_write()</a> </dd>
<dd>
<a class="el" href="group__gdsl__rbtree.html#gadf28f012b77d91409e2a4c0de0498bc7" title="Write the content of a red-black tree to a file into XML.">gdsl_rbtree_write_xml()</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
